import request from "../utils/request";

export const getChapterList = (cno) => {
  return request({
    url: "/system/catalogue/getList",
    params: {
      cno,
    },
  });
};

export const getCatalogue = (id) => {
    return request({
      url: "/system/catalogue/get",
      params: {
        id,
      },
    });
  };

export const insertChapter = (catalogue) => {
  return request({
    url: "/system/catalogue/insert",
    method: "POST",
    data: catalogue,
  });
};

export const updateChapter = (catalogue) => {
  return request({
    url: "/system/catalogue/update",
    method: "POST",
    data: catalogue,
  });
};

export const deleteChapter = (chapterId, cno) => {
  return request({
    url: "/system/catalogue/delete",
    method: "DELETE",
    params: {
      chapterId,
      cno,
    },
  });
};
